import request from '@/utils/request.js'

// 列表
export const userList = (params) => {
    return request({
        url: '/sys/user/list',
        method: 'get',
        params: params
    })
}

// 机构树形列表
export const agencySelectList = () => {
    return request({
        url: '/agency/select',
        method: 'get'
    })
}

// 角色数据
export const roleSelect = () => {
    return request({
        url: '/sys/role/select',
        method: 'get'
    })
}

// 添加用户
export const addUser = (data) => {
    return request({
        url: '/sys/user/save',
        method: 'post',
        data: data
    })
}

// 删除用户
export const delUser = (data) => {
    return request({
        url: '/sys/user/delete',
        method: 'post',
        data: data
    })
}

// 用户详情
export const userDetail = (id) => {
    return request({
        url: '/sys/user/info/' + id,
        method: 'get',
    })
}

// 编辑用户
export const editUser = (data) => {
    return request({
        url: '/sys/user/update',
        method: 'post',
        data: data
    })
}
